package org.gap.domain;

import java.io.Serializable;

import javax.persistence.Id;

import javax.persistence.*;

/**
 */
public class CodesPostauxPK implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 */
	public CodesPostauxPK() {
	}

	/**
	 */

	@Column(name = "CDP_PAYS", length = 3, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	public String cdpPays;
	/**
	 */

	@Column(name = "CDP_CODE_POSTAL", length = 12, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	public String cdpCodePostal;
	/**
	 */

	@Column(name = "CDP_N_INSEE", length = 5, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	public String cdpNInsee;
	/**
	 */

	@Column(name = "CDP_LOCALITE", length = 32, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	public String cdpLocalite;

	/**
	 */
	public void setCdpPays(String cdpPays) {
		this.cdpPays = cdpPays;
	}

	/**
	 */
	public String getCdpPays() {
		return this.cdpPays;
	}

	/**
	 */
	public void setCdpCodePostal(String cdpCodePostal) {
		this.cdpCodePostal = cdpCodePostal;
	}

	/**
	 */
	public String getCdpCodePostal() {
		return this.cdpCodePostal;
	}

	/**
	 */
	public void setCdpNInsee(String cdpNInsee) {
		this.cdpNInsee = cdpNInsee;
	}

	/**
	 */
	public String getCdpNInsee() {
		return this.cdpNInsee;
	}

	/**
	 */
	public void setCdpLocalite(String cdpLocalite) {
		this.cdpLocalite = cdpLocalite;
	}

	/**
	 */
	public String getCdpLocalite() {
		return this.cdpLocalite;
	}

	/**
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((cdpPays == null) ? 0 : cdpPays.hashCode()));
		result = (int) (prime * result + ((cdpCodePostal == null) ? 0 : cdpCodePostal.hashCode()));
		result = (int) (prime * result + ((cdpNInsee == null) ? 0 : cdpNInsee.hashCode()));
		result = (int) (prime * result + ((cdpLocalite == null) ? 0 : cdpLocalite.hashCode()));
		return result;
	}

	/**
	 */
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof CodesPostauxPK))
			return false;
		CodesPostauxPK equalCheck = (CodesPostauxPK) obj;
		if ((cdpPays == null && equalCheck.cdpPays != null) || (cdpPays != null && equalCheck.cdpPays == null))
			return false;
		if (cdpPays != null && !cdpPays.equals(equalCheck.cdpPays))
			return false;
		if ((cdpCodePostal == null && equalCheck.cdpCodePostal != null) || (cdpCodePostal != null && equalCheck.cdpCodePostal == null))
			return false;
		if (cdpCodePostal != null && !cdpCodePostal.equals(equalCheck.cdpCodePostal))
			return false;
		if ((cdpNInsee == null && equalCheck.cdpNInsee != null) || (cdpNInsee != null && equalCheck.cdpNInsee == null))
			return false;
		if (cdpNInsee != null && !cdpNInsee.equals(equalCheck.cdpNInsee))
			return false;
		if ((cdpLocalite == null && equalCheck.cdpLocalite != null) || (cdpLocalite != null && equalCheck.cdpLocalite == null))
			return false;
		if (cdpLocalite != null && !cdpLocalite.equals(equalCheck.cdpLocalite))
			return false;
		return true;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder("CodesPostauxPK");
		sb.append(" cdpPays: ").append(getCdpPays());
		sb.append(" cdpCodePostal: ").append(getCdpCodePostal());
		sb.append(" cdpNInsee: ").append(getCdpNInsee());
		sb.append(" cdpLocalite: ").append(getCdpLocalite());
		return sb.toString();
	}
}
